Functions

int X int Y int Z bool Invisible bool CollDetection int Jump int SwordJinx int ItemJinx int Drunk int Dir int HitDir int HP int MP int MaxHP int MaxMP int Action int HeldItem int LadderX int LadderY bool InputStart bool InputMap bool InputUp bool InputDown bool InputLeft bool InputRight bool InputA bool InputB bool InputL bool InputR bool InputAxisUp bool InputAxisDown bool InputAxisLeft bool InputAxisRight bool PressStart bool PressMap bool PressUp bool PressDown bool PressLeft bool PressRight bool PressA bool PressB bool PressL bool PressR bool PressAxisUp bool PressAxisDown bool PressAxisLeft bool PressAxisRight int InputMouseX int InputMouseY int InputMouseB int InputMouseZ bool Item[] int Equipment int Tile int Flip int HitZHeight int HitXOffset int HitYOffset int DrawXOffset int DrawYOffset int DrawZOffset float Misc[] void Warp void PitWarp void SelectAWeapon void SelectBWeapon
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

Link Functions and Variables Documentation

Functions and Properties

Return Type Function Information
intX
Link's X position on the screen, in pixels. Float values passed to this will be cast to int.
intY
Link's Y position on the screen, in pixels. Float values passed to this will be cast to int.
intZ
Link's Z position on the screen, in pixels. Float values passed to this will be cast to int.
boolInvisible
Whether Link is currently being draw to the screen. Set true to remove him from view.
boolCollDetection
If true, Link's collision detection with npcs and eweapons is currently turned off.
This variable works on a different system to clocks and the level 4 cheat, so it will not
necessarily return true if they are set.
intJump
Link's upward velocity, in pixels. If negative, Link will fall.
The downward acceleration of Gravity (in Init Data) modifies this value every frame.
intSwordJinx
The time, in frames, until Link regains use of his sword. -1 signifies
a permanent loss of the sword.
intItemJinx
The time, in frames, until Link regains use of his items. -1 signifies
a permanent loss of his items.
intDrunk
The time, in frames, that Link will be 'drunk'. If positive, the player's
controls are randomly interfered with, causing Link to move erratically.
This value is decremented once per frame. As the value of Drunk approaches 0
the intensity of the effect decreases.
intDir
The direction Link is facing. Use the DIR_ constants in std.zh to set
or compare this variable. Note: even though Link can move diagonally if the
quest allows it, his sprite doesn't ever use any of the diagonal directions
which are intended for enemies only.
intHitDir
The direction Link should bounce in when he is hit. This is mostly useful for
simulating getting hit by setting Link->Action to LA_GOTHURTLAND.
intHP
Link's current hitpoints, in 16ths of a heart.
intMP
Link's current amount of magic, in 32nds of a magic block.
intMaxHP
Link's maximum hitpoints, in 16ths of a heart.
intMaxMP
Link's maximum amount of magic, in 32nds of a magic block.
intAction
Link's current action. Use the LA_ constants in std.zh to set or
compare this value. The effect of writing to this field is currently
undefined.
intHeldItem
The item that Link is currently holding up; reading or setting this
field is undefined if Link's action is not current a hold action.
Use the I_ constants in std.zh to specify the item, or -1 to show
no item. Setting HeldItem to values other than -1 or a valid item
ID is undefined.
intLadderX
The X position of Link's stepladder, or 0 if no ladder is onscreen.
This is read-only; while setting it is not syntactically incorrect, it does nothing.
intLadderY
The Y position of Link's stepladder, or 0 if no ladder is onscreen.
This is read-only; while setting it is not syntactically incorrect, it does nothing.
**Input Functions ***
The following Input* boolean values return true if the player is pressing
the corresponding button, analog stick, or key. Writing to this variable simulates
the press or release of that referenced button, analog stick, or key.
boolInputStart
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/
boolInputMap
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

boolInputUp
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
boolInputDown
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
boolInputLeft
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
boolInputRight
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
boolInputA
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
boolInputB
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
boolInputL
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
boolInputR
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
boolInputAxisUp
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
boolInputAxisDown
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
boolInputAxisLeft
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
boolInputAxisRight
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
boolPressStart
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;
boolPressMap
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

boolPressUp
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
boolPressDown
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
boolPressLeft
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
boolPressRight
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
boolPressA
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
boolPressB
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
boolPressL
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
boolPressR
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
bool PressB;
boolPressAxisUp
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
bool PressB;
bool PressL;
bool PressR;
bool PressEx1
bool PressEx2
bool PressEx3
boolPressAxisDown
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
bool PressB;
bool PressL;
bool PressR;
bool PressEx1
bool PressEx2
bool PressEx3
bool PressEx4
boolPressAxisLeft
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
bool PressB;
bool PressL;
bool PressR;
bool PressEx1
bool PressEx2
bool PressEx3
bool PressEx4
bool PressAxisUp;
boolPressAxisRight
The following Press* boolean values return true if the player activated
the corresponding button, analog stick, or key this frame. Writing to this
variable simulates the press or release of that referenced button, analog stick
or keys input press state.
*/

bool InputStart;
bool InputMap;
bool InputUp;
bool InputDown;
bool InputLeft;
bool InputRight;
bool InputA;
bool InputB;
bool InputL;
bool InputR;
bool InputEx1
bool InputEx2
bool InputEx3
bool InputEx4
bool InputAxisUp;
bool InputAxisDown;
bool InputAxisLeft;
bool InputAxisRight;

bool PressStart;
bool PressMap;
bool PressUp;
bool PressDown;
bool PressLeft;
bool PressRight;
bool PressA;
bool PressB;
bool PressL;
bool PressR;
bool PressEx1
bool PressEx2
bool PressEx3
bool PressEx4
bool PressAxisUp;
bool PressAxisDown;
intInputMouseX
The mouse's in-game X position. This value is undefined if
the mouse pointer is outside the Zelda Classic window.
intInputMouseY
The mouse's in-game Y position. This value is undefined if
the mouse pointer is outside the Zelda Classic window.
intInputMouseB
Whether the left or right mouse buttons are pressed, as two flags OR'd (|) together;
use the MB_ constants or the Input'X'Click functions in std.zh to check the button states.
InputMouseB is read only; while setting it is not syntactically incorrect, it does nothing
If you are not comfortable with binary, you can use the InputMouse'x' functions in std.zh
intInputMouseZ
The current state of the mouse's scroll wheel, negative for scrolling down and positive for scrolling up.
boolItem[]
True if Link's inventory contains the item whose ID is the index of
the array access. Use the I_ constants in std.zh as an index into this array.
intEquipment
Contains the item IDs of what is currently equiped to Link's A and B buttons.
The first 8 bits contain the A button item, and the second 8 bits contain the B button item.
Currently it is only possible to retrieve this value and not to set it.
If you are not comfortable with performing binary operations
you can use the GetLinkEquipment'X' functions from std.zh.
intTile
The current tile associated with Link. The effect of writing to this variable is undefined.
Because Link's tile is not determined until he is drawn, this will actually represent
Link's tile in the previous frame.
intFlip
The current tile associated with Link. The effect of writing to this variable is undefined.
Because Link's tile is not determined until he is drawn, this will actually represent
Link's tile flip in the previous frame.
intHitZHeight
The Z-axis height of Link's hitbox, or collision rectangle.
The lower it is, the lower a flying or jumping enemy must fly in order to hit Link.
Writing to this is ignored unless Extend is set to values >=3.
intHitXOffset
The X offset of Link's hitbox, or collision rectangle.
Setting it to positive or negative values will move Link's hitbox left or right.
Writing to this is ignored unless Extend is set to values >=3.
intHitYOffset
The Y offset of Link's hitbox, or collision rectangle.
Setting it to positive or negative values will move Link's hitbox up or down.
Writing to this is ignored unless Extend is set to values >=3.
intDrawXOffset
The X offset of Link's sprite.
Setting it to positive or negative values will move the sprite's tiles left or right relative to its position.
Writing to this is ignored unless Extend is set to values >=3.
intDrawYOffset
The Y offset of Link's sprite.
Setting it to positive or negative values will move the sprite's tiles up or down relative to its position.
Writing to this is ignored unless Extend is set to values >=3.
intDrawZOffset
The Z offset of Link's sprite.
Writing to this is ignored unless Extend is set to values >=3.
floatMisc[]
An array of 16 miscellaneous variables for you to use as you please.
These variables are not saved with Link.
voidWarp(int DMap, int screen)
Warps link to the given screen in the given DMap, just like if he'd
triggered an 'Insta-Warp'-type warp.
voidPitWarp(int DMap, int screen)
This is identical to Warp, but Link's X and Y positions are preserved
when he enters the destination screen, rather than being set to the
Warp Return square.
voidSelectAWeapon(int dir)
Sets the A button item to the next one in the given direction based on
the indices set in the subscreen. This will skip over items if A and B
would be set to the same item.
If the quest rule "Can Select A-Button Weapon On Subscreen" is disabled,
this function does nothing.
voidSelectBWeapon(int dir)
Sets the B button item to the next one in the given direction based on
the indices set in the subscreen. This will skip over items if A and B
would be set to the same item.